<?php

    #-------------------------------------------------------------#
	# This file is part of the Tekuna MVC Microframework for PHP. #
	# (c) 2009 Niels Jäckel <niels.jaeckel@tekuna.org>            #
	# Please visit http://tekuna.org/ for more information.       #
	#                                                             #
	# This software is licensed under the MIT License. Please     #
	# view the LICENSE file for the full text of this license.    #
    #-------------------------------------------------------------#


	// set the application root constant to a special test directory
	define('APPLICATION_ROOT', dirname(__FILE__) . DIRECTORY_SEPARATOR .
                               '..' . DIRECTORY_SEPARATOR .
                               'org' . DIRECTORY_SEPARATOR .
                               'tekuna' . DIRECTORY_SEPARATOR .
                               'test' . DIRECTORY_SEPARATOR .
                               'testApplication' . DIRECTORY_SEPARATOR);

	// define test base directory
	define('TEKUNA_TEST_ROOT', realpath('../org/tekuna/test/') . DIRECTORY_SEPARATOR);

	// define pass showing constant
	define('SHOW_TEST_PASSES', isset($_GET['showPasses']));

	// load framework bootstrap
	require_once '../bootstrap.php';

	// exclude strict standard and deprecation warnings because of simpletest's PHP4 compatibility...
	error_reporting(E_ALL & !E_STRICT & !E_DEPRECATED);

	// load the simpletest framework
	require_once('../lib/simpletest/unit_tester.php');
	require_once('../lib/simpletest/reporter.php');

	// load adapter classes
	require_once TEKUNA_TEST_ROOT .'AbstractTekunaTestSuite.abstract.php';
	require_once TEKUNA_TEST_ROOT .'AbstractTekunaTestCase.abstract.php';
	require_once TEKUNA_TEST_ROOT .'TekunaTestReporter.class.php';

	// create new test suite
	$objTestSuite = new TestSuite('Complete Tekuna Unit Test');

	// add the test files
	$objTestSuite -> addTestFile(TEKUNA_TEST_ROOT .'base/BaseTestSuite.class.php');
	$objTestSuite -> addTestFile(TEKUNA_TEST_ROOT .'core/CoreTestSuite.class.php');

	// run the tests
	$objTestSuite -> run(new TekunaTestReporter());

